package com.itheima.ui;
import com.itheima.dao.IAccountDao;
import com.itheima.service.IAccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class Client {

    public static void main(String[] args) {
//        IAccountService service = new AccountServiceImpl();
//        1.获取核心容器对象
        ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
        //像这种方式，一读取完配置文件时，马上就创建相应的对象，而BeanFactory便是什么时候要根据id来获取对象，用的时候才创建
//        2.根据id 获取Bean对象
        IAccountService service = (IAccountService) ac.getBean("accountService");

//        IAccountDao accountDao = ac.getBean("accountDao",IAccountDao.class);


        System.out.println(service);
//        service.saveAccount();

    }
}
